home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 36 / vfos_dv.zip / VIO_DV.INC < prev   
Text File  |  1988-10-30  |  16KB  |  538 lines

  1. ;
  2. ; VFOS_IBM VFOSSIL driver by Bob Hartman  (SysOp of 1:132/101).
  3. ; Copyright 1988 by Spark Software.  ALL RIGHTS RESERVED.
  4. ;* Modified version for DESQview, David Page (1:109/604)
  5.  
  6. VioGetMode proc far
  7.  
  8.         Enter_Vio
  9.  
  10.         Check_Handle 00
  11.         
  12.         DESQview_shadow
  13.         les     di,[bp+8]               ; get pointer to buffer
  14.         mov     cx,es:[di]              ; get length
  15.         push    cs                      ; set up ds
  16.         pop     ds
  17.         mov     si,offset mode_info     ; get pointer to mode buffer
  18.         cmp     cx,es:[di]              ; how does it stack up
  19.         jbe     f00_100                 ; it looks ok
  20.         mov     cx,es:[di]              ; get the other value
  21.  
  22. f00_100:
  23.         cmp     cx,3                    ; is it less than 3
  24.         jae     f00_101                 ; it is still good
  25.         mov     ax,382                  ; bad buffer size
  26.         jmp     f00_out                 ; get out
  27.  
  28. f00_101:
  29.     
  30.         cld
  31.         repnz   movsb                   ; move the data
  32.         mov     ax,0                    ; set up return code
  33.  
  34.         Exit_Vio 00,6                   ; get out
  35.  
  36. VioGetMode endp
  37.  
  38. VioSetMode proc far
  39.  
  40.         mov     ax,355
  41.         ret     6
  42.  
  43. VioSetMode endp
  44.  
  45. VioGetConfig proc far
  46.  
  47.         Enter_Vio
  48.  
  49.         Check_Handle 02
  50.  
  51.         DESQview_shadow
  52.  
  53.         les     di,[bp+8]               ; get pointer to buffer
  54.         mov     cx,es:[di]              ; get length
  55.         push    cs                      ; set up ds
  56.         pop     ds
  57.         mov     si,offset mode_info     ; get pointer to mode buffer
  58.         cmp     cx,es:[di]              ; how does it stack up
  59.         jbe     f02_100                 ; it looks ok
  60.         mov     cx,es:[di]              ; get the other value
  61.  
  62. f02_100:
  63.         cld
  64.         repnz   movsb                   ; move the data
  65.  
  66.         mov     ax,0                    ; set up return code
  67.  
  68.         Exit_Vio 02,6                   ; get out
  69.  
  70. VioGetConfig endp
  71.  
  72. VioWrtTTY proc far
  73.  
  74.         Enter_Vio
  75.  
  76.         Check_Handle 03
  77.  
  78.         DESQview_shadow
  79.         push    cs
  80.         pop     ds
  81.         mov     ax,ansi_state           ; get current ANSI mode
  82.         mov     cx,[bp+8]               ; get string length
  83.         lds     dx,[bp+10]              ; get pointer to string
  84.        
  85.         or      ax,ax                   ; are we in ANSI mode?
  86.         jz      f03_100                 ; no ANSI, do it the other way
  87.  
  88.         mov     ah,40h                  ; set up for a write call
  89.         mov     bx,1                    ; use stdout
  90.         int     21h                     ; go do it
  91.  
  92.         jmp     f03_ok                  ; get out
  93.  
  94. f03_100:
  95.         mov     si,dx                   ; get the pointer to ds:si
  96.  
  97. f03_101:
  98.         lodsb                           ; get a byte
  99.         mov     ah,0eh                  ; write TTY mode
  100.         mov     bh,0                    ; page number
  101.         int     10h                     ; go do it through the BIOS
  102.         loop    f03_101                 ; do another one
  103.  
  104. f03_ok:
  105.         mov     ax,0                    ; say it was all ok
  106.  
  107.         Exit_Vio 03,8                   ; get out
  108.  
  109. VioWrtTTY endp
  110.  
  111. VioGetANSI proc far
  112.  
  113.         Enter_Vio
  114.  
  115.         Check_Handle 04
  116.         DESQview_shadow
  117.         push    cs
  118.         pop     ds
  119.         mov     ax,ansi_state           ; get current ansi state
  120.         les     di,[bp+8]               ; get pointer for where to put it
  121.         stosw                           ; mov it there
  122.  
  123.         mov     ax,0                    ; all is ok
  124.  
  125.         Exit_Vio 04,6                   ; get out
  126.  
  127. VioGetANSI endp
  128.  
  129. VioSetANSI proc far
  130.  
  131.         Enter_Vio
  132.  
  133.         Check_Handle 05
  134.         DESQview_shadow
  135.         lds     si,[bp+8]               ; get the pointer to the state
  136.         lodsw                           ; get the state
  137.         push    cs
  138.         pop     ds
  139.         mov     ansi_state,ax           ; save it away
  140.  
  141.         mov     ax,0                    ; all ok
  142.  
  143.         Exit_Vio 05,6                   ; get out
  144.  
  145. VioSetANSI endp
  146.  
  147. VioGetCurPos proc far
  148.  
  149.         Enter_Vio
  150.  
  151.         Check_Handle 06
  152.         DESQview_shadow
  153.         mov     ah,3                    ; get cursor position BIOS call
  154.         mov     bh,0
  155.         int     10h                     ; actually get it
  156.  
  157.         les     di,[bp+8]               ; get the pointer to the row
  158.         mov     dh,al                   ; save row in al
  159.         xor     ah,ah                   ; clear out ah
  160.         stosw                           ; store the row
  161.  
  162.         les     di,[bp+12]              ; get the pointer to the column
  163.         mov     dl,al                   ; get the column to al
  164.         stosw                           ; store the column
  165.  
  166.         mov     ax,0                    ; all ok
  167.  
  168.         Exit_Vio 06,10                  ; get out
  169.  
  170. VioGetCurPos endp
  171.  
  172. VioSetCurPos proc far
  173.  
  174.         Enter_Vio
  175.  
  176.         Check_Handle 07
  177.         DESQview_shadow
  178.         mov     ah,2                    ; BIOS call to set the cursor pos
  179.         mov     bh,0
  180.         mov     dh,byte ptr [bp+10]     ; get the row
  181.         cmp     dh,0                    ; check to see it is ok
  182.         jae     f07_100
  183.         mov     ax,358                  ; no good
  184.         jmp     f07_out
  185.  
  186. f07_100:
  187.         cmp     dh,24                   ; check it again
  188.         jbe     f07_101
  189.         mov     ax,358                  ; no good
  190.         jmp     f07_out
  191.  
  192. f07_101:
  193.         mov     dl,byte ptr [bp+8]      ; get the column
  194.         cmp     dl,0                    ; check if it is ok
  195.         jae     f07_102
  196.         mov     ax,359                  ; no good
  197.         jmp     f07_out
  198.  
  199. f07_102:
  200.         cmp     dl,79                   ; check it again
  201.         jbe     f07_103
  202.         mov     ax,359                  ; no good
  203.         jmp     f07_out
  204.  
  205. f07_103:
  206.         int     10h                     ; do the BIOS call
  207.  
  208.         mov     ax,0                    ; all ok
  209.  
  210.         Exit_Vio 07,6                   ; get out
  211.  
  212. VioSetCurPos endp
  213.  
  214. VioGetCurType proc far
  215.  
  216.         Enter_Vio
  217.  
  218.         Check_Handle 08
  219.         DESQview_shadow
  220. ;*routine below duplicated from original subfunction 0 code for
  221. ;*DESQview's benefit
  222.         mov     ah,3                     ;* read cursor position
  223.         mov     bh,0                     ;* for video page 0
  224.         int     10h
  225.         xor     ah,ah                    ;* zero ah
  226.         mov     al,ch                    ;* get starting scan line of cursor
  227.         mov     curs_info.curs_start,ax  ;* put it into table
  228.         mov     al,cl                    ;* get ending scan line of cursor
  229.         mov     curs_info.curs_end,ax    ;* put it into table
  230. ;* end of borrowed routine, now REAL cursor info should be there
  231.  
  232.         les     di,[bp+8]               ; get pointer to buffer
  233.         push    cs                      ; set up ds
  234.         pop     ds
  235.         mov     si,offset curs_info     ; get pointer to cursor info
  236.         mov     cx,8                    ; length of cursor info
  237.  
  238.         cld
  239.         repnz   movsb                   ; move the data
  240.  
  241.         mov     ax,0                    ; set up return code
  242.  
  243.         Exit_Vio 08,6                   ; get out
  244.  
  245. VioGetCurType endp
  246.  
  247. VioSetCurType proc far
  248.  
  249.         Enter_Vio
  250.  
  251.         Check_Handle 09
  252.         DESQview_shadow
  253.         mov     ax,cs
  254.         mov     es,ax
  255.         mov     ds,ax
  256.         lds     si,[bp+8]               ; get pointer to buffer
  257.  
  258.         mov     ch,byte ptr ds:[si]     ;* get starting line
  259.         mov     cl,byte ptr ds:[si+2]   ;* get ending line
  260.         mov     ax,ds:[si+6]            ; get attribute
  261.         jmp     f09_100                 ;* disable cursor attribute
  262.         cmp     ax,-1                   ; is it off?
  263.         jne     f09_100                 ; no, so continue
  264.         mov     ch,30h                  ; turn off cursor
  265.         mov     cl,30h                  ; turn off cursor
  266.  
  267. f09_100:
  268.         mov     ah,1                    ;* set cursor type BIOS
  269.         mov     bh,0                    ;* for video page zero
  270.         int     10h                     ; use BIOS to set the position
  271.  
  272.         mov     di,offset curs_info     ; get pointer to cursor info
  273.         lds     si,[bp+8]               ; get pointer to buffer
  274.         mov     cx,8                    ; length of cursor info
  275.  
  276.         cld
  277.         repnz   movsb                   ; move the data
  278.  
  279.         mov     ax,0                    ; set up return code
  280.  
  281.         Exit_Vio 09,6                   ; get out
  282.  
  283. VioSetCurType endp
  284.  
  285. VioScrollUp proc far
  286.  
  287.         Enter_Vio
  288.  
  289.         Check_Handle 10
  290.         DESQview_shadow
  291. ; set up address of upper left corner, checking for out of range
  292. ; check bottom right corner for out of range
  293. ; determine number of words to copy per line
  294. ; determine number of rows to do
  295. ; move each line
  296. ; fill in blanked lines
  297.  
  298.         mov     ax,116
  299.  
  300.         Exit_Vio 10,16                  ; get out
  301.  
  302. VioScrollUp endp
  303.  
  304. VioScrollDn proc far
  305.  
  306.         Enter_Vio
  307.  
  308.         Check_Handle 11
  309.         DESQview_shadow
  310. ; set up address of upper left corner, checking for out of range
  311. ; check bottom right corner for out of range
  312. ; determine number of words to copy per line
  313. ; determine number of rows to do
  314. ; move each line
  315. ; fill in blanked lines
  316.  
  317.         mov     ax,116
  318.  
  319.         Exit_Vio 11,16                  ; get out
  320.  
  321. VioScrollDn endp
  322.  
  323. VioReadCellStr proc far
  324.  
  325.         Enter_Vio
  326.  
  327.         Check_Handle 12
  328.         DESQview_shadow
  329.         Do_Row_Col 12,10,8
  330.  
  331.  
  332.         mov     si,di                   ; get the address as source index
  333.         mov     ax,adapter_base         ; offset for color card
  334.         mov     ds,ax                   ; ds:si is now set up
  335.  
  336.         les     di,[bp+14]              ; get the pointer to count
  337.         mov     cx,es:[di];             ; put count in cx
  338.         les     di,[bp+18]              ; get the pointer in es:di
  339.  
  340.         cld
  341.         repnz   movsb                   ; move the bytes
  342.  
  343.         mov     ax,0                    ; successful return
  344.  
  345.         Exit_Vio 12,14                  ; get out
  346.  
  347. VioReadCellStr endp
  348.  
  349. VioReadCharStr proc far
  350.  
  351.         Enter_Vio
  352.  
  353.         Check_Handle 13
  354.         DESQview_shadow
  355.         Do_Row_Col 13,10,8
  356.  
  357.  
  358.         mov     si,di                   ; get the address as source index
  359.         mov     ax,adapter_base         ; offset for color card
  360.         mov     ds,ax                   ; ds:si is now set up
  361.  
  362.         les     di,[bp+14]              ; get length pointer
  363.         mov     cx,es:[di]              ; get length
  364.         les     di,[bp+18]              ; get the pointer in es:di
  365.  
  366. f13_100:
  367.         movsb                           ; move a byte
  368.         inc     di                      ; get past attribute
  369.         loop    f13_100                 ; do the next one
  370.  
  371.         mov     ax,0                    ; successful return
  372.  
  373.         Exit_Vio 13,14                  ; get out
  374.  
  375. VioReadCharStr endp
  376.  
  377. VioWrtCellStr proc far
  378.  
  379.         Enter_Vio
  380.  
  381.         Check_Handle 14
  382.         DESQview_shadow
  383.         Do_Row_Col 14,10,8
  384.  
  385.  
  386.         mov     ax,adapter_base         ; offset for color card
  387.         mov     es,ax                   ; es:di is now set up
  388.  
  389.         mov     cx,[bp+12]              ; get length
  390.         lds     si,[bp+14]              ; get the pointer in ds:si
  391.  
  392.         cld
  393.         repnz   movsb                   ; move the bytes
  394.  
  395.         mov     ax,0                    ; successful return
  396.  
  397.         Exit_Vio 14,12                  ; get out
  398.  
  399. VioWrtCellStr endp
  400.  
  401. VioWrtCharStr proc far
  402.  
  403.         Enter_Vio
  404.  
  405.         Check_Handle 15
  406.         DESQview_shadow
  407.         Do_Row_Col 15,10,8
  408.     
  409.  
  410.         mov     ax,adapter_base         ; offset for color card
  411.         mov     es,ax                   ; es:di is now set up
  412.  
  413.         mov     cx,[bp+12]              ; get length
  414.         lds     si,[bp+14]              ; get the pointer in ds:si
  415.  
  416. f15_100:
  417.         movsb                           ; move a byte
  418.         inc     di                      ; get past attribute
  419.         loop    f15_100                 ; do the next one
  420.  
  421.         mov     ax,0                    ; successful return
  422.  
  423.         Exit_Vio 15,12                  ; get out
  424.  
  425. VioWrtCharStr endp
  426.  
  427. VioWrtCharStrAtt proc far
  428.  
  429.         Enter_Vio
  430.  
  431.         Check_Handle 16
  432.         DESQview_shadow
  433.         Do_Row_Col 16,14,12
  434.  
  435.  
  436.         mov     ax,adapter_base         ; offset for color card
  437.         mov     es,ax                   ; es:di is now set up
  438.  
  439.         mov     cx,[bp+16]              ; get length
  440.         lds     si,[bp+8]               ; get the pointer in ds:si
  441.         lodsb                           ; get the attribute
  442.         mov     ah,al                   ; save the attribute
  443.         lds     si,[bp+18]              ; get the pointer to chars
  444.  
  445. f16_100:
  446.         lodsb                           ; get the character
  447.         xchg    ah,al                   ; put in proper order
  448.         stosw                           ; save the cell
  449.         xchg    ah,al                   ; save attribute again
  450.         loop    f16_100                 ; loop for next one
  451.  
  452.         mov     ax,0                    ; successful return
  453.  
  454.         Exit_Vio 16,16                  ; get out
  455.  
  456. VioWrtCharStrAtt endp
  457.  
  458. VioWrtNAttr proc far
  459.  
  460.         Enter_Vio
  461.  
  462.         Check_Handle 17
  463.         DESQview_shadow
  464.         Do_Row_Col 17,10,8
  465.  
  466.  
  467.         mov     ax,adapter_base         ; offset for color card
  468.         mov     es,ax                   ; es:di is now set up
  469.  
  470.         mov     cx,[bp+12]              ; get length
  471.         lds     si,[bp+14]              ; get the pointer in ds:si
  472.         lodsb                           ; get the character attribute
  473.  
  474. f17_100:
  475.         inc     di                      ; get past character byte
  476.         stosb                           ; save the attribute
  477.         loop    f17_100                 ; loop for next one
  478.  
  479.         mov     ax,0                    ; successful return
  480.  
  481.         Exit_Vio 17,12                  ; get out
  482.  
  483. VioWrtNAttr endp
  484.  
  485. VioWrtNCell proc far
  486.  
  487.         Enter_Vio
  488.  
  489.         Check_Handle 18
  490.         DESQview_shadow
  491.         Do_Row_Col 18,10,8
  492.  
  493.  
  494.         mov     ax,adapter_base         ; offset for color card
  495.         mov     es,ax                   ; es:di is now set up
  496.  
  497.         mov     cx,[bp+12]              ; get length
  498.         lds     si,[bp+14]              ; get the pointer in ds:si
  499.         lodsw                           ; get the character cell in AX
  500.  
  501.         cld
  502.         repnz   stosw                   ; save the cell
  503.  
  504.         mov     ax,0                    ; successful return
  505.  
  506.         Exit_Vio 18,12                  ; get out
  507.  
  508. VioWrtNCell endp
  509.  
  510. VioWrtNChar proc far
  511.  
  512.         Enter_Vio
  513.  
  514.         Check_Handle 19
  515.         DESQview_shadow
  516.         Do_Row_Col 19,10,8
  517.  
  518.  
  519.         mov     ax,adapter_base         ; offset for color card
  520.         mov     es,ax                   ; es:di is now set up
  521.  
  522.         mov     cx,[bp+12]              ; get length
  523.         lds     si,[bp+14]              ; get the pointer in ds:si
  524.         lodsb                           ; get the character
  525.  
  526. f19_100:
  527.         stosb                           ; save the character
  528.         inc     di                      ; get past attribute byte
  529.         loop    f19_100                 ; loop for next one
  530.  
  531.         mov     ax,0                    ; successful return
  532.  
  533.         Exit_Vio 19,12                  ; get out
  534.  
  535. VioWrtNChar endp
  536.  
  537.  
  538.